package com.libgdxbar.pvzlikegame.systems.state;

import com.libgdxbar.pvzlikegame.entities.Entity;
import com.libgdxbar.pvzlikegame.entities.EntitySystem;
import org.libgdxbar.projects.interfaces.IState;

public class StateSystem extends EntitySystem{

	@Override
	protected boolean isMatch(Entity entity) {
		return entity instanceof IState;
	}

	@Override
	public void run(float delta) {
		for (Entity entity : entities) {
			IState state = (IState) entity;
			state.changeToPreviousState();
		}
	}
}
